<table width="100%"><tr><td width="20%">
<a href="../index.html">&lt; index</a><br />
<a href="index.html">&lt; 2. Console</a><br />
<a href="console_init.html">&lt; 2.1 Initializing the console</a>
</td><td width="60%">
<p align="center">
=====================================<br />
2.1.5 Switching between windowed and fullscreen modes<br />
=====================================<br />
</p></td><td width="20%">
</td></tr></table>
<style type="text/css">
.code { color:#444444; background-color:#EEEEEE;}
pre { color:#444444; background-color:#EEEEEE;}
table.param td { border : 1px solid #000000; }
th { background-color: #44BBFF; color: #FFFFFF }
table.none td { border : 0 }
</style>
<p class="code"><pre>
C++ : static void TCODConsole::setFullscreen(bool fullscreen)
C   : void TCOD_console_set_fullscreen(bool fullscreen)
Py  : console_set_fullscreen(fullscreen)
</pre></p>
This function switches the root console to fullscreen or windowed mode.<br />
<table class="param">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td>fullscreen</td><td>true to switch to fullscreen mode.<br/>false to switch to windowed mode.<br /></td></tr>
</table>
Note that there is no predefined key combination to switch to/from fullscreen. You have to do this in your own code.<br />
Example for an Alt-Enter combination :<br />
<p class="code"><pre>
C++ : TCOD_key_t key=TCODConsole::checkForKeypress();
      if ( key.vk == TCODK_ENTER && key.lalt ) TCODConsole::setFullscreen(!TCODConsole::isFullscreen());
C   : TCOD_key_t key=TCOD_console_check_for_keypress();
      if ( key.vk == TCODK_ENTER && key.lalt ) TCOD_console_set_fullscreen(!TCOD_console_is_fullscreen());
Py  : key=libtcod.console_check_for_keypress()
      if key.vk == libtcod.KEY_ENTER and key.lalt : libtcod.console_set_fullscreen(not libtcod.console_is_fullscreen())
</pre></p>
